1. Field of the Invention
The present invention relates to a bar code reader and a bar code reading method and, more particularly, to a bar code reader and a bar code reading method in which a bar code having a plurality of characters is read by partition reading.
2. Description of the Related Art
In recent years, as represented by POS systems in distributors, the management of goods or the like is generally performed by bar codes. For example, in a POS system of shops, information such as the type and a price of goods is coded into the format of a bar code, and the bar code is printed on the goods. Thereafter, checkout is performed by reading the bar code on a cash disk, and the number of sold goods are counted on real time. The number of sold goods is used in stock management and buying management.
Bar codes are roughly classified into a WPC code such as a JAN code, a UPC code, or an EAN code and a second code having a variable length. The WPC code, has, as shown in FIG. 6, a left guard bar (LGB: also called xe2x80x9cstart guard bar (SGB)xe2x80x9d) arranged on the left end, a center bar (CB) arranged at the center, and a right guard bar (RGB: also called xe2x80x9cend guard bar (EGB)xe2x80x9d) arranged on the right end. A left-side data block constituted by 6 or 4 data characters (to be referred to as a xe2x80x9ccharacterxe2x80x9d hereinafter) is formed between the LGB and the CB. A right-side data block constituted by 6 or 4 characters is formed between the CB and the RGB. The character is a minimum unit of coded numeral values or coded symbols, and is constituted by a plurality of modules.
Since the patterns of the LGB, CB, and the RGB are determined by standards, a bar code reader can detect the LGB, CB, and the RGB. The bar code reader can read the characters of a bar code on the basis of the LGB, the CB, and the RGB. The bar code reader reads the characters by three methods, i.e., a xe2x80x9ccontinuous readingxe2x80x9d method, a xe2x80x9cblock readingxe2x80x9d method, and a xe2x80x9cpartition readingxe2x80x9d method. The xe2x80x9ccontinuous readingxe2x80x9d method is a method in which, when an LGB, a CB, and an RGB are detected by performing a bar code scanning trace once, characters arranged between these bars are recognized as a bar code to be demodulated. The xe2x80x9cblock readingxe2x80x9d method is a method in which only the block of characters arranged between an LGB or an RGB and a CB is recognized as a bar code, two blocks are independently demodulated, the demodulated data of the blocks are synthesized (coupled) with each other, and data modulated into one bar code is reproduced. The xe2x80x9cpartition readingxe2x80x9d method is a method in which even a character string connected to at least one guard bar or center bar is recognized as a bar code, the pieces of demodulated data of these characters which are independently read are synthesized with each other, and data corresponding to one entire bar code is reproduced.
By the manner of passing of a scanning beam through a bar code, as shown in FIGS. 7A, 7B and 7C, partition reading methods are classified into three methods (1) a xe2x80x9c2-partitionxe2x80x9d method (see FIG. 7A) in which demodulated data including only an LGB and demodulated data including a CB and an RGB are detected and synthesized with each other to acquire the data of the entire bar code, (2) a xe2x80x9c3-1-partitionxe2x80x9d method (FIG. 7B) in which demodulated data including only an LGB, demodulated data including only a CB, and demodulated data including only an RGB are detected and synthesized with each other to acquire the data of the entire bar code, and (3) a xe2x80x9c3-2-partitionxe2x80x9d method (see FIG. 7C) in which demodulated data including only an LGB, demodulated data including only a CB, and demodulated data including the CB and an RGB are detected and synthesized with each other to acquire the data of the entire bar code.
In a conventional partition reading method, when the demodulated data of a data block is formed by synthesizing two demodulated data, the following methods are employed. More specifically, when a left-side data block is formed by synthesis, demodulated data to be synthesized are compared with each other, two characters overlap (in the example shown in FIGS. 7A, 7B and 7C, the third and fourth characters overlap), and it is checked whether these characters are the same or not. At this time, when the two overlapping characters are the same, the demodulated data are synthesized with each other.
Here, when the process is performed in the xe2x80x9c2-partitionxe2x80x9d method, the demodulated data of the entire bar code is obtained at this time. On the other hand, when the process is performed in the xe2x80x9c3-1-partitionxe2x80x9d method or the xe2x80x9c3-2-partitionxe2x80x9d method, modulated data synthesized by the process is synthesized with other modulated data to acquire the modulated data of the entire bar code. Thereafter, character count check and modulus check are performed to the demodulated data of the entire bar code. When preferable check results are obtained, the demodulated data are handled as normal demodulated data.
However, the above method has the following problem. For example, as shown in FIG. 8A, it is assumed that there is a bar code (UPC/A code) in which data blocks each constituted by 6 characters are stored between an LGB and a CB and between the CB and an RGB. This bar code has data of xe2x80x9c027000 388150xe2x80x9d.
In this case, it is assumed that the bar code is scanned by a scanning beam (a) and a scanning beam (b). The scanning means (a) enters from the middle of the first character of the left-side data block, and does not passes through the CB. On the other hand, the scanning beam (b) passes from the fourth character of the left-side data block to the RGB. At this time, when the bright/dark pattern of the first character of the part through which the scanning beam (a) passes is the same as the bright/dark pattern of the LGB, the first character is erroneously recognized as an LGB (called a xe2x80x9cbit shiftxe2x80x9d). As a result, the pieces of demodulated data obtained by the scanning beam (a) serve as an LGB, a first character (C1 (O-2)) a second character (C2 (O-7)), a third character (C3 (O-0)) a fourth character (C4 (O-0)), and a fifth character (C5 (O-0)). On the other hand, the pieces of demodulated data obtained by the scanning beam (b) serve as a fourth character (C4 (O-0)), a fifth character (C5 (O-0), a sixth character (C6 (O-0)), a CB, characters of a right-side data block, and an RGB.
The pieces of the two modulated data have overlapping parts with respect to the fourth and fifth blocks of a left-side block. In the normal code of the left-side data block, overlapping parts are the same as shown in FIG. 8B because the fourth to sixth characters are 0. For this reason, the pieces of these demodulated data are synthesized with each other as appropriate demodulated data, erroneous read data xe2x80x9c270000 388150xe2x80x9d is formed.
Thereafter, character count check and modulus check (modulus 10/weight 3) are performed to the erroneous read data, a judgment about accuracy is made. However, the error demodulated data has the accurate number of characters of a data block and an accurate modulus check result. For this reason, it cannot be detected that the data is erroneous read data.
It is an object of the present invention to provide a bar code reader and a bar code reading method which can prevent a bar code from being erroneously read by a bit shift when a bar code is read by a partition reading method.
The present invention employs the following configuration to accomplish the above-mentioned object. More specifically, the present invention is a bar code reader. This bar code reader comprises a bar code data detecting unit for scanning a bar code constituted by a plurality of characters at least twice to detect bar code data on the scanning locus, a demodulating section for demodulating respective bar code data detected by the bar code data detection section, a first judging section for detecting overlapping parts between first demodulated data on a first scanning locus and second demodulated data on a second scanning locus of the demodulated data demodulated by the demodulating section to judge whether the overlapping parts are constituted by a predetermined number of characters or not, a second judging section for, when it is judged by the first judging section that the overlapping parts are constituted by a predetermined number of characters, judging whether the overlapping parts are the same between the first demodulated data and the second demodulated data or not, a third judging section for, when it is judged by the second judging section that the overlapping parts are the same, judging whether the characters constituting the overlapping parts are the same or not, and a fourth judging section for, when it is judged by the third judging section that the characters are the same, judging whether a character just before the overlapping part of the first demodulated data, a character just after the overlapping part of the second demodulated data, and characters constituting the overlapping parts are all the same or not.
The present invention further comprises a synthesizing section for synthesizing the first demodulated data and the second demodulated data, and may be designed such that, when it is judged by the fourth judging section that the characters are all the same, the synthesizing section does not synthesize the first demodulated data and the second demodulated data.
The first judging section of the present invention may be arranged such that the overlapping parts are constituted by a predetermined number of characters when the overlapping parts are constituted by two characters.
According to the present invention, the fourth judging section judges whether a character just before the overlapping part of the first demodulated data, a character just after the overlapping part of the second demodulated data, and the characters constituting the overlapping parts are all the same or not. At this time, when the characters are all the same, erroneous reading caused by a bit shift probably occurs. Therefore, for example, when it is judged by the fourth judging section that the characters are all the same, the synthesizing section does not synthesize the first demodulated data and the second demodulated data with each other. In this case, a bar code can be prevented from being erroneously read by a bit shift.
The fourth judging section may judge whether a character just before the character just before the overlapping part of the first demodulated data is the same as the characters or not, or whether a character just after the character just after the overlapping part of the second demodulated data is the same as the characters or not.
The bar code is, for example, a WPC code, an EAN code, a JAN code, or a UPC code and may have a data block constituted by 4 or more characters. In particular, the present invention is preferably used for, e.g., an EAN-13 code or a UPC/A code.